﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TRPOP.Common
{
    /// <summary>
    /// 链接类型  0虚链接，1实链接，2索引链接、3外链接
    /// </summary>
    public class LinkType
    {
        /// <summary>
        /// 链接类型 枚举类
        /// </summary>
        public enum EnumElement
        {

            /// <summary>
            /// 虚链接
            /// </summary>
            VirtualLink = 0,
            /// <summary>
            /// 实链接
            /// </summary>
            RealLink = 1,
            /// <summary>
            /// 索引链接
            /// </summary>
            IndexLink = 2,
            /// <summary>
            /// 外链接
            /// </summary>
            OutLink=3

        }
        /// <summary>
        /// GetAll
        /// </summary>
        /// <returns></returns>
        public static Dictionary<int, string> GetAll()
        {
            Dictionary<int, string> dicList = new Dictionary<int, string>();
            dicList.Add((int)EnumElement.VirtualLink, "虚链接");
            dicList.Add((int)EnumElement.RealLink, "实链接");
            dicList.Add((int)EnumElement.IndexLink, "索引链接");
            dicList.Add((int)EnumElement.OutLink, "外链接");

            return dicList;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetValue(int key)
        {
            string strValue = "";

            if (GetAll().ContainsKey(key))
            {
                return GetAll()[key];
            }

            return strValue;
        }

    }

    /// <summary>
    /// 约克cms 发布模式
    /// </summary>
    public class ContentPubType
    {
        /// <summary>
        /// 发布枚举
        /// </summary>
        public enum EnumElement
        {

            /// <summary>
            /// 静态发布
            /// </summary>
            StaticPub = 1,
            /// <summary>
            /// 动态发布
            /// </summary>
            DynamicPub = 2,
            /// <summary>
            /// 不对外发布 
            /// </summary>
            NotOutPub = 3

        }
        /// <summary>
        /// GetAll
        /// </summary>
        /// <returns></returns>
        public static Dictionary<int, string> GetAll()
        {
            Dictionary<int, string> dicList = new Dictionary<int, string>();
            dicList.Add((int)EnumElement.StaticPub, "静态发布");
            dicList.Add((int)EnumElement.DynamicPub, "动态发布");
            dicList.Add((int)EnumElement.NotOutPub, "不对外发布");

            return dicList;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetValue(int key)
        {
            string strValue = "";

            if (GetAll().ContainsKey(key))
            {
                return GetAll()[key];
            }

            return strValue;
        }
    }

    /// <summary>
    /// 约克cms 结点类型
    /// </summary>
    public class NodeType
    {
        /// <summary>
        /// 结点类型
        /// </summary>
        public enum EnumElement
        {

            /// <summary>
            /// 实结点
            /// </summary>
            TrueNode = 1,
            /// <summary>
            /// 虚结点
            /// </summary>
            VirualNode = 2

        }
    }
    /// <summary>
    /// 表单采集值类型
    /// </summary>
    public class FieldInputPickerType
    {
        /// <summary>
        /// 颜色
        /// </summary>
       public static string ColorPicker = "color";
        /// <summary>
       /// 时间
        /// </summary>
       public static string DatePicker = "date";
        /// <summary>
       /// 图片录入
        /// </summary>
       public static string ImgPicker = "upload_img";
        /// <summary>
       /// 附件录入
        /// </summary>
       public static string AttachPicker = "upload_attach";
        /// <summary>
        /// 无
        /// </summary>
       public static string NonePicker = "none";
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
       public static Dictionary<string, string> GetAll()
       {
           Dictionary<string, string> dicList = new Dictionary<string, string>();
           dicList.Add(NonePicker, "无");
           dicList.Add(ColorPicker, "颜色");
           dicList.Add(DatePicker, "时间");
           dicList.Add(ImgPicker, "图片录入");
           dicList.Add(AttachPicker, "附件录入");
           return dicList;
       }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
       public static string GetValue(string key)
       {
           string strValue = "";

           if (GetAll().ContainsKey(key))
           {
               return GetAll()[key];
           }

           return strValue;
       }
    }

    /// <summary>
    /// 附件属性
    /// </summary>
    public class AttributeType
    {
        /// <summary>
        /// 附件属性
        /// </summary>
        public enum EnumElement
        {

            /// <summary>
            ///  图片
            /// </summary>
            Pic = 1,
            /// <summary>
            /// 附件
            /// </summary>
            Attr = 2,
            /// <summary>
            /// 广告
            /// </summary>
            Ads=3
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static Dictionary<int, string> GetAll()
        {
            Dictionary<int, string> dicList = new Dictionary<int, string>();
            dicList.Add((int)EnumElement.Pic, "图片");
            dicList.Add((int)EnumElement.Attr, "附件");
            dicList.Add((int)EnumElement.Ads, "广告");
            return dicList;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string GetValue(int key)
        {
            string strValue = "";

            if (GetAll().ContainsKey(key))
            {
                return GetAll()[key];
            }

            return strValue;
        }
    }

    /// <summary>
    /// 图片分类
    /// </summary>
    public class ImgType
    {
        /// <summary>
        /// 图片资源分类
        /// </summary>
        public enum ImgResourceType
        {
            /// <summary>
            /// PC网页版
            /// </summary>
            Normal = 1,
            /// <summary>
            /// iphone手机版
            /// </summary>
            Iphone = 2      //<var name="WebPageType" value="iphone" />
        }
        /// <summary>
        /// 根据变量值获取当前页面类型
        /// </summary>
        /// <param name="strVarValue"></param>
        /// <returns></returns>
        public static ImgResourceType GetTypeByPageTypeVar(string strVarValue)
        {
            switch (strVarValue.ToLower())
            {
                case "iphone":
                    return ImgResourceType.Iphone;
                default:
                    return ImgResourceType.Normal;
            }
        }
        /// <summary>
        /// 资源集合在数据源里的列名
        /// </summary>
        public static string strImgResourceCollectionColumnName = "ImgResourceCollection";
        /// <summary>
        /// 模板变量里标识当前页面类型的变量
        /// </summary>
        public static string strPageTypeVarName = "WebPageType";
    }
}
